package com.warmheart.builder.secret;

import com.warmheart.core.rs.base.BaseRsBuilder;
import com.warmheart.core.rs.oper.Rs;
import com.warmheart.entity.secret.SecretKey;

/**
 * 
 * @ClassName: SecretKey
 * @Description: 密钥实体RsBuilder类，对应表名称为tb_secret_key
 *               温馨提示：不要修改该实体RsBuilder类的任何字段
 * @author ZhangJianyang
 * @date 2025年06月16日 下午13:05:35
 *
 */
public class SecretKeyRsBuilder extends BaseRsBuilder<SecretKey, SecretKeyRsBuilder> {

    private final SecretKey t;

    @Override
    protected SecretKeyRsBuilder self() {
        return this;
    }

    @Override
    public SecretKey core() {
        return this.t;
    }

    public SecretKeyRsBuilder(SecretKey secretKey) {
        t = secretKey;
    }

    /**
     * 密钥名称
     */
    private Rs<SecretKey, SecretKeyRsBuilder> name;

    /**
     * 密钥类型
     */
    private Rs<SecretKey, SecretKeyRsBuilder> keyType;

    /**
     * 加密后的密钥内容
     */
    private Rs<SecretKey, SecretKeyRsBuilder> encryptedKey;

    /**
     * 加密向量
     */
    private Rs<SecretKey, SecretKeyRsBuilder> encryptionIv;

    /**
     * 密钥描述
     */
    private Rs<SecretKey, SecretKeyRsBuilder> description;

    /**
     * 所属用户ID
     */
    private Rs<SecretKey, SecretKeyRsBuilder> ownerId;

    /**
     * 是否激活
     */
    private Rs<SecretKey, SecretKeyRsBuilder> state;

    /**
     * 过期时间
     */
    private Rs<SecretKey, SecretKeyRsBuilder> expiresTime;

    public Rs<SecretKey, SecretKeyRsBuilder> name() {
        if (this.name == null) {
            this.name = new Rs<SecretKey, SecretKeyRsBuilder>(self(), "name", "name");
        }
        return this.name;
    }

    public Rs<SecretKey, SecretKeyRsBuilder> keyType() {
        if (this.keyType == null) {
            this.keyType = new Rs<SecretKey, SecretKeyRsBuilder>(self(), "key_type", "keyType");
        }
        return this.keyType;
    }

    public Rs<SecretKey, SecretKeyRsBuilder> encryptedKey() {
        if (this.encryptedKey == null) {
            this.encryptedKey = new Rs<SecretKey, SecretKeyRsBuilder>(self(), "encrypted_key", "encryptedKey");
        }
        return this.encryptedKey;
    }

    public Rs<SecretKey, SecretKeyRsBuilder> encryptionIv() {
        if (this.encryptionIv == null) {
            this.encryptionIv = new Rs<SecretKey, SecretKeyRsBuilder>(self(), "encryption_iv", "encryptionIv");
        }
        return this.encryptionIv;
    }

    public Rs<SecretKey, SecretKeyRsBuilder> description() {
        if (this.description == null) {
            this.description = new Rs<SecretKey, SecretKeyRsBuilder>(self(), "description", "description");
        }
        return this.description;
    }

    public Rs<SecretKey, SecretKeyRsBuilder> ownerId() {
        if (this.ownerId == null) {
            this.ownerId = new Rs<SecretKey, SecretKeyRsBuilder>(self(), "owner_id", "ownerId");
        }
        return this.ownerId;
    }

    public Rs<SecretKey, SecretKeyRsBuilder> state() {
        if (this.state == null) {
            this.state = new Rs<SecretKey, SecretKeyRsBuilder>(self(), "state", "state");
        }
        return this.state;
    }

    public Rs<SecretKey, SecretKeyRsBuilder> expiresTime() {
        if (this.expiresTime == null) {
            this.expiresTime = new Rs<SecretKey, SecretKeyRsBuilder>(self(), "expires_time", "expiresTime");
        }
        return this.expiresTime;
    }
}